package com.lanju.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ColumnDefault;

import com.fasterxml.jackson.annotation.JsonIgnore;
/**
 * 用户表
 * @author linjp
 * @CrateTime 20181015
 */
@Entity
@Table(name="lj_user")
public class User implements Serializable{

	private static final long serialVersionUID = 2367346290820717260L;
	
	private String userId;
	private String openId;
	private String userCode;
	private String phone;
	private int sex;
	private String password;
	private Date createTime;
	private int flag;
	private String nickName;
	private String headImg;
	private String IdCard;
	private String jobName;
	private String msg;
	private int status;
	private Bills bills;
	private String realName;
	private String reviceType;
	private String experienceTime;
	private String introduction;
	public    Set<UserIdCard> idCardset=new HashSet<UserIdCard>();
	public    Set<House> houseSet=new HashSet<House>();


	@Id
	@Column(name = "userId", unique = true, nullable = false)
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getNickName() {
		return nickName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	public String getHeadImg() {
		return headImg;
	}
	@ColumnDefault(value="/dataResourceImages/household/huanglaoshi.jpg,")
	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}

	public String getIdCard() {
		return IdCard;
	}

	public void setIdCard(String idCard) {
		IdCard = idCard;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	@JsonIgnore
    @OneToOne(mappedBy = "user",cascade = CascadeType.ALL)
	public Bills getBills() {
		return bills;
	}

	public void setBills(Bills bills) {
		this.bills = bills;
	}
	@JsonIgnore
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "user")
	public Set<UserIdCard> getIdCardset() {
		return idCardset;
	}

	public void setIdCardset(Set<UserIdCard> idCardset) {
		this.idCardset = idCardset;
	}
	@JsonIgnore
	@OneToMany(cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="user")
	public Set<House> getHouseSet() {
		return houseSet;
	}

	public void setHouseSet(Set<House> houseSet) {
		this.houseSet = houseSet;
	}

	public String getReviceType() {
		return reviceType;
	}

	public void setReviceType(String reviceType) {
		this.reviceType = reviceType;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public String getExperienceTime() {
		return experienceTime;
	}

	public void setExperienceTime(String experienceTime) {
		this.experienceTime = experienceTime;
	}
	
}
